<%@page import="fr.uniscol.model.BaseAnneeScolaire"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<jsp:useBean id="enseignant" type="fr.uniscol.model.Enseignant" scope="request" />

<script lang="text/javascript">
    
    function creerServiceEnseignant(){
        
        $(".modal-body").load("service.enseignant.create", 
        {
            "enseignantid" : ${enseignant.id}
        });
        
        $("#btnAnnuler").html("Annuler");
        $("#btnValider").html("Enregistrer");
        $("#btnValider").click(function(){
            document.frmServiceEnseignant.submit();
        });
        $("#serviceFormModal").modal("show");
    }
    
</script>

Services
<ul>
	<c:forEach items="${enseignant.services}" var="s">
		<li>${s.matiere.libelleEdition} - ${s.groupe.libelle} - (${s.nbrHeures}h)</li>
	</c:forEach>
</ul>

<button type="button" class="btn btn-primary btn-xs" onClick="javascript:creerServiceEnseignant()">Créer un nouveau service</button>   

<c:set var="modalId" value="serviceFormModal" scope="request" />
<c:set var="modalTitle" value="Service" scope="request" />
<jsp:include page="../../components/modal.jsp" flush="true" />